package org.devgframwork.datasync.admin.rabbit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.devgframwork.datasync.admin.rabbit.dao.EsConfigMapper;
import org.devgframwork.datasync.core.entity.ElasticSearchConfig;
import org.devgframwork.datasync.core.model.ExecutorTypeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EsConfigService extends ServiceImpl<EsConfigMapper, ElasticSearchConfig> {

    @Autowired
    private EsConfigMapper esConfigMapper;

    public List<ElasticSearchConfig> getEs56ConfigList() {
        QueryWrapper<ElasticSearchConfig> queryWrapper = new QueryWrapper();
        queryWrapper.eq("IS_DELETE", 0);
        queryWrapper.eq("ES_VERSION", ExecutorTypeEnum.es56.getTypeName());
        return esConfigMapper.selectList(queryWrapper);
    }
}
